<style>
.BMap_Marker img{border-radius:50%;width:36px;height:36px; box-shadow: 5px 10px 10px rgba(0, 0, 0, 0.5);}
</style>
<div class='fui-page fui-page-current page-commission-register'>
	<div id="allmap" style="height: 11rem;padding:0px 0px;"></div>
	<div ng-if="pagedata.member.stop==1" class='fui-content'>
        <div  class='content-empty' >
            <i class='icon icon-info text-danger'></i>
            <br/><span class="text-danger">禁止访问，请联系客服！</span>
            <br/><a class="btn btn-danger" href="javascript:;" ng-click="access_json('jy_wuliu/index/')">去平台逛逛</a>
        </div>
	</div>
	<div ng-if="pagedata.member.stop !=1">
	<div class='fui-content' ng-if="!pagedata.apply && !pagedata.can_apply">
			<div  class='fui-list-group'>
				<div class='fui-list-group-title'><i class="icon icon-lights"></i> 友情提醒</div>
				<div class='fui-list'>
					<div ng-if="pagedata.member.type==1" class='fui-list-inner'>
						<div class='text'>本平台累计带来用户满 <span class="text-danger text-bold">{{pagedata.chezhu_fromnum}}</span>人，
							才可成为&lt;<span class="text-danger text-bold">{{pagedata.pluginset.title || '本平台'}}</span>&gt;车主。您已带来 <span class="text-danger text-bold">{{pagedata.fromnow}}</span> 人，请继续努力！</div>
					</div>
					<div ng-if="pagedata.member.type==2" class='fui-list-inner'>
						<div class='text'>本平台累计带来用户满 <span class="text-danger text-bold">{{pagedata.zhuanxian_fromnum}}</span>人，
							才可成为&lt;<span class="text-danger text-bold">{{pagedata.pluginset.title || '本平台'}}</span>&gt;专线。您已带来 <span class="text-danger text-bold">{{pagedata.fromnow}}</span> 人，请继续努力！</div>
					</div>
				</div>
			</div>
			<a class="btn btn-danger block" href="javascript:;" onclick="$('#showsharecover').modal();">前往推送给好友</a>
	</div>
	<div ng-if="pagedata.apply" class='fui-content'>
		<div ng-if="pagedata.member.type==0 || pagedata.applystatus==0" class='content-info' >
            <i class='icon icon-clock'></i>
            <br/><span class="">谢谢您的支持，请等待审核！</span>
            <br/><a class="btn btn-danger" href="javascript:;" ng-click="access_json('jy_wuliu/index/')">去平台逛逛</a>
        </div>
		<div ng-if="pagedata.member.type==1" class='content-info' >
            <i class='icon icon-clock'></i>
            <br/><span class="">恭喜您，您的车主申请已审核通过！</span>
            <br/><a class="btn btn-danger" href="javascript:;" ng-click="access_json('jy_wuliu/myquan/')">前往我的圈</a>
        </div>
		<div ng-if="pagedata.applystatus==2" class='content-info' >
            <i class='icon icon-clock'></i>
            <br/><span class="">非常抱歉，您的申请被管理员拒绝！</span>
            <br/><a class="btn btn-danger" href="javascript:;" ng-click="access_json('jy_wuliu/index/')">去平台逛逛</a>
        </div>
	</div>
    <div ng-if="!pagedata.apply && pagedata.can_apply" class='fui-content'>
        <div class="fui-cell-group" style='margin-top:0'>
            <div class="fui-cell-title">
                欢迎加入<span class='text-danger'>{{pagedata.pluginset.title || '物流圈'}}</span>，请填写{{pagedata.member.type==1?'车主':'专线'}}申请信息
            </div>
			<div class="weui_cells" style="margin-top:0">
			<div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">商户名称</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="pagedata.member.title" placeholder="请填写商户名称">
                </div>
            </div>
			<div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">姓名</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="pagedata.member.realname" placeholder="请填写真实姓名，用于结算">
                </div>
            </div>
			<div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">手机号</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="pagedata.member.mobile" placeholder="请填写手机号码方便联系">
                </div>
            </div>
			<div ng-if="pagedata.member.type==1" class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">车牌</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="pagedata.member.chepai" placeholder="请输入您的车牌">
                </div>
            </div>
			<div ng-if="pagedata.member.type==1" class="weui_cell">
								<div class="weui_cell_hd"><label class="weui_label">货车前照</label></div>
								<div class="weui_cell_bd weui_cell_primary">
									<ul class="weui_uploader_files" ng-if="pagedata.member.cheimg">
										  <li class="weui_uploader_file" style="background-image:url({{tomedia(pagedata.member.cheimg)}})"></li>
									</ul>
									<div class="weui_uploader_input_wrp">
										 <input class="weui_uploader_input" ng-model="pagedata.member.cheimg" ng-click="up_file(pagedata.member,'cheimg','image')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple="">
									</div>
								</div>
			</div>
			<div ng-if="pagedata.member.type==2" class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">营业执照</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="pagedata.member.zhizhao" placeholder="请输入您的营业执照">
                </div>
            </div>
			<div ng-if="pagedata.member.type==2" class="weui_cell">
								<div class="weui_cell_hd"><label class="weui_label">门店前照</label></div>
								<div class="weui_cell_bd weui_cell_primary">
									<ul class="weui_uploader_files" ng-if="pagedata.member.zhuanxianimg">
										  <li class="weui_uploader_file" style="background-image:url({{tomedia(pagedata.member.zhuanxianimg)}})"></li>
									</ul>
									<div class="weui_uploader_input_wrp">
										 <input class="weui_uploader_input" ng-model="pagedata.member.zhuanxianimg" ng-click="up_file(pagedata.member,'zhuanxianimg','image')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple="">
									</div>
								</div>
			</div>
			<div class="weui_cell">
                <div class="weui_cell_hd"><label for="" class="weui_label">地址</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" ng-model="pagedata.member.address" type="text" value="" placeholder="">
                </div>
                <div class="weui_cell_ft" ng-click="tool.choose_location(pagedata.member,'address','address')">
                    <i class="icon jinyunicon icon-ditu"></i>
                </div>
			</div>
			<div class="weui_cell">
                <div class="weui_cell_hd"><label for="" class="weui_label">坐标</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <div class="row row-fix">
							<div class="col-xs-6 col-sm-6">
								<input type="text" ng-model="pagedata.member.lat_lng.lng" placeholder="经度"  class="form-control" />
							</div>
							<div class="col-xs-6 col-sm-6">
								<input type="text" ng-model="pagedata.member.lat_lng.lat" placeholder="纬度"  class="form-control" />
							</div>
					</div>
                </div>
                <div class="weui_cell_ft" ng-click="tool.choose_location(pagedata.member,'lat_lng','lat_lng')">
                     <i class="icon jinyunicon icon-ditu"></i>选择坐标
                </div>
			</div>
			<div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">微信号</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="pagedata.member.wechat" placeholder="请填写微信号,方便联系">
                </div>
            </div>
			 </div>
            <div class="fui-cell-group">
                <div class="fui-cell small ">
                    <div class="fui-cell-info">
                        <label class="checkbox-inline">
                            <input type="checkbox" class="fui fui-checkbox fui-checkbox-danger" ng-model="pagedata.member.agree" /> 我已经阅读并了解了<a id="btn-apply" ng-click="pagedata.show_content=true" style="color:#337ab7;">【申请入驻协议】</a>。
                        </label>

                    </div>
                </div>

            </div>

            <div ng-show="pagedata.show_content" class="modal-bg pop-apply-hidden" >
                <div class="modal-content" style="top:10%;width:90%;left:5%">
                    <div class="closebtn" ng-click="pagedata.show_content=false" style="opacity:1;"><i class="icon icon-cuowu"></i></div>
                    <div class="news-body">
						<div class="title">申请入驻协议 / <small>Read &nbsp;Ggree</small></div>
                        <div class="text" ng-bind-html="trust(pagedata.systemxieyi.systemcontent)"></div>
                    </div>
					<div class="modal-footer">
                            <div ng-click="pagedata.show_content=false" class="mod-check" style="width: 100%; margin: 0;">我已阅读</div>
                    </div>
                </div>
            </div>

        </div>
        <div class='btn btn-danger block btn-submit' style="margin-top:2rem" ng-click="post(pagedata.member,'jy_wuliu/apply/apply/')">申请成为{{pagedata.member.type==1?'车主':'专线商'}}</div>
	</div>
	</div>
</div>
<!--分享弹层-->
<div id="showsharecover" class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
<div class="modal-dialog" style="width:100%;left:0;top:0">
	<div id="cover">
		<div class='fui-mask-m visible'></div>
		<div class='arrow'></div>
		<div class='content'>请点击右上角<br/>通过【发送给朋友】<br/>推荐给好友</div>
	</div>
</div>
</div>
<script>
window.scope.location(function(res){
		if(!scope.pagedata.member.pcd.city){
				scope.pagedata.member.pcd.province = res.addressComponents.province;
				scope.pagedata.member.pcd.city = res.addressComponents.city;
		}
		scope.pagedata.member.address = res.address;
		scope.pagedata.member.pcd.lat_lng = {'lat':res.lat_lng.lat,'lng':res.lat_lng.lng}
		scope.$evalAsync();
		require(['map'], function(BMap){
				var map = new BMap.Map("allmap");
				var point = new BMap.Point(res.lat_lng['lng'], res.lat_lng['lat']);
				map.centerAndZoom(point, 13.6);
				// 编写自定义函数,创建标注
				function addMarker(point,icon){
				  var marker = new BMap.Marker(point);
				  var icon=new BMap.Icon(icon,new BMap.Size(50,50));
				  marker.setIcon(icon);
				  map.addOverlay(marker);
				}
				var point = new BMap.Point(res.lat_lng['lng'], res.lat_lng['lat']);
				addMarker(point,scope.pagedata.member.avatar);
		});
});
</script>
